package HomeWork;

import java.util.Scanner;

public class NumJM {
    public static void main(String[] args) {
        System.out.println("请输入一个4位整数:");
        Scanner input = new Scanner(System.in);
        int num = input.nextInt();
        int gw = num%10;
        int gw1 = (gw+5)%10;

        int sw = num/10%10;
        int sw1 = (sw+5)%10;

        int bw = num/100%10;
        int bw1 = (bw+5)%10;

        int qw = num/1000;
        int qw1 = (qw+5)%10;

        int a = 0 ;
        a = qw1;
        qw1 = gw1;
        gw1 = a;

        int b = 0;
        b=bw1;
        bw1 = sw1;
        sw1 = b;

        int num1 = qw1*1000+bw1*100+sw1*10+gw1;
        System.out.println("加密后的数字为："+num1);
    }
}
